#include "historyrecord.h"

HistoryRecord::HistoryRecord(QString url)
{
    m_url = url;
    m_datetime = QDateTime::currentDateTime();
}

HistoryRecord::HistoryRecord()
{

}

#include <QDebug>

void HistoryRecord::load(QString str)
{
    QStringList list = str.split("#");
    QString date = list[0];
    QString url = list[1];
    setUrl(url);
    setDatetime(QDateTime::fromString(date.trimmed(), "yyyy-MM-dd-hh-mm-ss"));
}

void HistoryRecord::setDatetime(const QDateTime &datetime)
{
    m_datetime = datetime;
}

void HistoryRecord::setUrl(const QString &url)
{
    m_url = url;
}
